home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8498 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  920 b 

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question on stingizing
  5. Date: 4 Mar 1996 10:55:17 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4hfealINN5j9@keats.ugrad.cs.ubc.ca>
  8. References: <4hda43$f15@skivs.ski.org>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4hda43$f15@skivs.ski.org>, Gemini Thunder <gt@ns.oon.or.jp> wrote:
  12. >  I have looked over this problem, but can not figure out the why of
  13. >it.  I don't have a copy of the Standard, but I have read the FAQ 
  14. >(11.17), but it does not give the why of it either....
  15. >  Why is this necessary:
  16. >
  17. >#define A Hello
  18. >#define s(x) #x
  19. >#define ss(x) s(x)  /* why this circumvention for #defined ?? */
  20.  
  21. So that if the argument is itself is a macro, it can be expanded:
  22.  
  23. #define FOO abc
  24.  
  25. s(FOO)    -> "FOO"
  26. ss(FOO) -> s(abc) -> "abc"
  27. -- 
  28.  
  29.